#include <bits/stdc++.h>
using namespace std;
const int N = 500+10;
const int K = 6+1;
double P[3*K], A[N+3*K], B[N+3*K];
int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n, k1, k2, k3, a, b, c;
    cin >> n >> k1 >> k2 >> k3 >> a >> b >> c;
    for (int i = 1; i <= k1; ++i) {
        for (int j = 1; j <= k2; ++j) {
            for (int k = 1; k <= k3; ++k) if(!(i==a && j==b && k==c)){
                P[i+j+k] += 1;
            }
        }
    }
    for (int i = 3; i <= k1+k2+k3; ++i) {
        P[i] /= k1*k2*k3;
    }
    double p0 = 1.0 / (k1*k2*k3);

    for (int i = n; i >=0 ; --i) {
        for (int k = 3; k <= k1+k2+k3 ; ++k) {
            A[i] += P[k]*A[i+k];
            B[i] += P[k]*B[i+k];
        }
        A[i] += p0;
        B[i] += 1;
    }


    cout << setprecision(7) << fixed << B[0]/(1-A[0]);
    return 0;
}